﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MudEngine.Parsing
{
    public enum OpCodes : byte
    {
        /* single instruction */
        eof = 0,
        ldc_i1_0 = 1,
        ldc_i1_1 = 2,
        ldc_i2_0 = 3,
        ldc_i2_1 = 4,
        ldc_i4_0 = 5,
        ldc_i4_1 = 6,
        cand = 7,
        ceq = 8,
        cor = 9,
        gt = 10,
        gte = 11,
        lt = 12,
        lte = 13,
        cneq = 14,
        nop = 15,
        add = 16,
        and = 17,
        div = 18,
        xor = 19,
        mod = 20,
        mul = 21,
        or = 22,
        shl = 23,
        shr = 24,
        sub = 25,
        ret = 26,
        dup = 27,
        pop = 28,
        catch_e = 29,
        idx_nn = 30,
        idx_ne = 31,
        idx_en = 32,
        idx_ee = 33,
        idx_n = 34,
        idx_e = 35,
        stelem = 36,
        __S_INSTRUCTION = 50,

        /* 1 byte instruction */
        acol = 51,
        col = 52,
        __1B_INSTRUCTION = 60,

        /* 2 byte instruction */
        ldc_i2 = 61,
        __2B_INSTRUCTION = 70,

        /* 3 byte instruction */
        call = 71,
        call_virt = 72,
        __3B_INSTRUCTION = 80,

        /* 4 byte instruction */
        ldc_i4 = 81,
        call_i = 82,
        jmpf = 83,
        jmp = 84,
        larg = 85,
        lglob = 86,
        lloc = 87,
        lstr = 88,
        sarg = 89,
        sglob = 90,
        sloc = 91,
        catch_s = 92,
        jmpt = 93,
        __4B_INSTRUCTION = 120,

        /* 8 byte instruction */
        ldc_i8 = 121,
        __8B_INSTRUCTION = 130,

        bp = Byte.MaxValue,
    }
}
